import { RouteRecordRaw } from 'vue-router';

/**
 * 建议：路由 path 路径与文件夹名称相同，找文件可浏览器地址找，方便定位文件位置
 *
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      isLink：        是否超链接菜单，开启外链条件，`1、isLink: 链接地址不为空 2、isIframe:false`
 *      isHide：        是否隐藏此路由
 *      isKeepAlive：   是否缓存组件状态
 *      isAffix：       是否固定在 tagsView 栏上
 *      isIframe：      是否内嵌窗口，开启条件，`1、isIframe:true 2、isLink：链接地址不为空`
 *      roles：         当前路由权限标识，取角色管理。控制路由显示、隐藏。超级管理员：admin 普通角色：common
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

// 扩展 RouteMeta 接口
declare module 'vue-router' {
	interface RouteMeta {
		title?: string;
		isLink?: string;
		isHide?: boolean;
		isKeepAlive?: boolean;
		isAffix?: boolean;
		isIframe?: boolean;
		roles?: string[];
		icon?: string;
	}
}

/**
 * 定义动态路由
 * 前端添加路由，请在顶级节点的 `children 数组` 里添加
 * @description 未开启 isRequestRoutes 为 true 时使用（前端控制路由），开启时第一个顶级 children 的路由将被替换成接口请求回来的路由数据
 * @description 各字段请查看 `/@/views/system/menu/component/addMenu.vue 下的 ruleForm`
 * @returns 返回路由菜单数据
 */

export const dynamicRoutes: Array<RouteRecordRaw> = [
	{
		path: '/',
		name: '/',
		component: () => import('/@/layout/index.vue'),
		redirect: '/index',
		meta: {
			isKeepAlive: true,
		},
		children: [
			{
				path: '/index',
				name: 'index',
				component: () => import('/@/views/home/index.vue'),
				meta: {
					title: '概况',
					isLink: '',
					isHide: false,
					isKeepAlive: true,
					isAffix: false,
					isIframe: false,
					auth: 'overview',
					icon: 'svg-overview',
				},
			},
			{
				path: '/order',
				name: 'order',
				redirect: '/order/query',
				meta: {
					title: '订单管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'order:management',
					icon: 'svg-order',
				},
				children: [
					{
						path: '/order/query',
						name: 'orderQuery',
						component: () => import('/@/views/pages/order/query/index.vue'),
						meta: {
							title: '订单查询',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'order:search',
							icon: 'iconfont icon-shouye',
						},
						children: [
							{
								path: '/order/query/detail/:id',
								name: 'orderDetail',
								component: () => import('/@/views/pages/order/query/detail.vue'),
								meta: {
									title: '订单详情',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'order:details:invoke',
									icon: 'iconfont icon-shouye',
								},
							},
						],
					},
				],
			},
			{
				path: '/fulfill',
				name: 'fulfill',
				redirect: '/fulfill/demand',
				meta: {
					title: '履约管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'fulfillment:management',
					icon: 'svg-fulfill',
				},
				children: [
					{
						path: '/fulfill/demand',
						name: 'fulfillDemand',
						component: () => import('/@/views/pages/fulfill/demand/index.vue'),
						meta: {
							title: '采购需求单',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'order:search',
						},
					},
					{
						path: '/fulfill/waitDelivery',
						name: 'fulfillWaitDelivery',
						component: () => import('/@/views/pages/fulfill/waitDelivery/index.vue'),
						meta: {
							title: '待发货订单',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'order:search',
						},
					},

					{
						path: '/fulfill/after-sale',
						name: 'afterSale',
						component: () => import('/@/views/pages/fulfill/afterSale/index.vue'),
						meta: {
							title: '售后单管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'order:after-marketing',
							icon: 'iconfont icon-shouye',
						},
						children: [
							{
								path: '/order/after-sale/detail/:id',
								name: 'afterSaleDetail',
								component: () => import('/@/views/pages/order/query/detail.vue'),
								meta: {
									title: '售后详情',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'order:details:invoke',
									icon: 'iconfont icon-shouye',
								},
							},
						],
					},
					{
						path: '/fulfill/address',
						name: 'fulfillAddress',
						component: () => import('/@/views/pages/fulfill/address/index.vue'),
						meta: {
							title: '地址库管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'order:address:management',
						},
					},
				],
			},
			{
				path: '/goods',
				name: 'goods',
				redirect: '/goods/warehousing',
				meta: {
					title: '商品管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'product:management',
					icon: 'svg-goods',
				},
				children: [
					{
						path: '/goods/warehousing',
						name: 'goodsWarehousing',
						component: () => import('/@/views/pages/goods/warehousing/index.vue'),
						meta: {
							title: '货品入库',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:warehouse',
						},
					},
					{
						path: '/goods/list',
						name: 'goodsList',
						component: () => import('/@/views/pages/goods/list/index.vue'),
						meta: {
							title: '商品列表',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:list',
						},
						children: [
							{
								path: '/goods/list/add',
								name: 'addGood',
								component: () => import('/@/views/pages/goods/list/add.vue'),
								meta: {
									title: '新增商品',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:create:invoke',
								},
							},
							{
								path: '/goods/list/edit/:id',
								name: 'editGood',
								component: () => import('/@/views/pages/goods/list/add.vue'),
								meta: {
									title: '编辑商品',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									roles: ['admin', 'common'],
									auth: 'product:edit:invoke',
								},
							},
						],
					},
					{
						path: '/goods/sync',
						name: 'goodsSync',
						component: () => import('/@/views/pages/goods/sync/index.vue'),
						meta: {
							title: '商品同步',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:sync',
						},
					},
					{
						path: '/goods/type',
						name: 'goodsType',
						component: () => import('/@/views/pages/goods/type/index.vue'),
						meta: {
							title: '商品分类',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:category',
						},
					},
					{
						path: '/goods/brand',
						name: 'goodsBrand',
						component: () => import('/@/views/pages/goods/brand/index.vue'),
						meta: {
							title: '商品品牌',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:brand',
						},
					},
					// {
					// 	path: '/goods/unit',
					// 	name: 'goodsUnit',
					// 	component: () => import('/@/views/pages/goods/unit/index.vue'),
					// 	meta: {
					// 		title: '商品单位',
					// 		isLink: '',
					// 		isHide: false,
					// 		isKeepAlive: false,
					// 		isAffix: false,
					// 		isIframe: false,
					// 		roles: ['admin', 'common'],
					//
					// 	},
					// },
					{
						path: '/goods/argument',
						name: 'goodsArgument',
						component: () => import('/@/views/pages/goods/argument/index.vue'),
						meta: {
							title: '商品参数',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:args',
						},
						children: [
							{
								path: '/goods/argument/add',
								name: 'addGoodArgument',
								component: () => import('/@/views/pages/goods/argument/add.vue'),
								meta: {
									title: '新增参数',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:args:create:invoke',
								},
							},
							{
								path: '/goods/argument/edit/:id',
								name: 'editGoodArgument',
								component: () => import('/@/views/pages/goods/argument/add.vue'),
								meta: {
									title: '编辑参数',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:args:edit:invoke',
								},
							},
						],
					},
					{
						path: '/goods/service',
						name: 'goodsService',
						component: () => import('/@/views/pages/goods/service/index.vue'),
						meta: {
							title: '保障服务',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:assurance-service',
						},
					},
					{
						path: '/goods/freight',
						name: 'goodsFreight',
						component: () => import('/@/views/pages/goods/freight/index.vue'),
						meta: {
							title: '运费模板',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:transport-fee:template',
						},
						children: [
							{
								path: '/goods/freight/add',
								name: 'addGoodFreight',
								component: () => import('/@/views/pages/goods/freight/add.vue'),
								meta: {
									title: '新增模板',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:transport-fee:template:create:invoke',
								},
							},
							{
								path: '/goods/freight/edit/:id',
								name: 'editGoodFreight',
								component: () => import('/@/views/pages/goods/freight/add.vue'),
								meta: {
									title: '编辑模板',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:transport-fee:template:edit:invoke',
								},
							},
						],
					},
					{
						path: '/goods/price',
						name: 'goodsPrice',
						component: () => import('/@/views/pages/goods/price/index.vue'),
						meta: {
							title: '价格趋势',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'product:price:trend',
						},
						children: [
							{
								path: '/goods/price/detail/:id',
								name: 'goodPriceDetail',
								component: () => import('/@/views/pages/goods/price/detail.vue'),
								meta: {
									title: '价格趋势详情',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'product:price:trend:detail:invoke',
								},
							},
						],
					},
				],
			},
			{
				path: '/liquor-cert',
				name: 'liquor-cert',
				meta: {
					title: '酒藏管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'baijiu-cert:management',
					icon: 'svg-liquor-cert',
				},
				children: [
					{
						path: '/liquor-cert/monitoring',
						name: 'liquorCerMonitoring',
						component: () => import('/@/views/pages/liquorCer/monitoring/index.vue'),
						meta: {
							title: '酒藏监控',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'baijiu-cert:monitor',
						},
					},
					{
						path: '/liquor-cert/market',
						name: 'liquorCerMarket',
						component: () => import('/@/views/pages/liquorCer/market/index.vue'),
						meta: {
							title: '酒藏集市',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'baijiu-cert:market',
						},
					},
					{
						path: '/liquor-cert/bestow',
						name: 'liquorCerBestow',
						component: () => import('/@/views/pages/liquorCer/bestow/index.vue'),
						meta: {
							title: '酒藏赠送',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'baijiu-cert:give',
						},
					},
					{
						path: '/liquor-cert/pickup',
						name: 'liquorCerPickup',
						component: () => import('/@/views/pages/liquorCer/pickup/index.vue'),
						meta: {
							title: '酒藏提货',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'baijiu-cert:shipping',
						},
					},
				],
			},
			{
				path: '/store',
				name: 'store',
				redirect: '/store/query',
				meta: {
					title: '门店管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'shop:management',
					icon: 'svg-store',
				},
				children: [
					{
						path: '/store/list',
						name: 'storeStoreList',
						component: () => import('/@/views/pages/store/list/index.vue'),
						meta: {
							title: '门店管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'shop:management:sub',
						},
						children: [
							{
								path: '/store/list/add',
								name: 'addStoreList',
								component: () => import('/@/views/pages/store/list/add.vue'),
								meta: {
									title: '新增门店',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'shop:management:sub:create:invoke',
								},
							},
							{
								path: '/store/list/edit/:id',
								name: 'editStoreList',
								component: () => import('/@/views/pages/store/list/add.vue'),
								meta: {
									title: '编辑门店',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'shop:management:sub:edit:invoke',
								},
							},
							{
								path: '/store/list/import',
								name: 'importStoreList',
								component: () => import('/@/views/pages/store/list/import.vue'),
								meta: {
									title: '导入门店',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'shop:management:sub:import:invoke',
								},
							},
						],
					},
					{
						path: '/store/type',
						name: 'storeType',
						component: () => import('/@/views/pages/store/type/index.vue'),
						meta: {
							title: '门店类型',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'shop:type',
						},
					},
				],
			},
			{
				path: '/advertisement',
				name: 'advertisement',
				redirect: '/advertisement/list',
				meta: {
					title: '广告管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'advertisement:management',
					icon: 'svg-advertising',
				},
				children: [
					{
						path: '/advertisement/list',
						name: 'advertisementList',
						component: () => import('/@/views/pages/advertisement/index.vue'),
						meta: {
							title: '广告管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'advertisement:management:sub',
						},
						children: [
							{
								path: '/advertisement/list/add',
								name: 'advertisementAdd',
								component: () => import('/@/views/pages/advertisement/add.vue'),
								meta: {
									title: '新增广告',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'advertisement:create:invoke',
								},
							},
							{
								path: '/advertisement/list/edit/:id',
								name: 'advertisementEdit',
								component: () => import('/@/views/pages/advertisement/add.vue'),
								meta: {
									title: '编辑广告',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'advertisement:edit:invoke',
								},
							},
						],
					},
				],
			},
			{
				path: '/content',
				name: 'content',
				redirect: '/content/list',
				meta: {
					title: '内容管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'content:management',
					icon: 'svg-content',
				},
				children: [
					{
						path: '/content/subject',
						name: 'contentSubject',
						component: () => import('/@/views/pages/content/subject/index.vue'),
						meta: {
							title: '内容专题',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'content:topic',
						},
					},
					{
						path: '/content/anti-fake',
						name: 'contentAntiFake',
						component: () => import('/@/views/pages/content/antiFake/index.vue'),
						meta: {
							title: '防伪图鉴',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'content:verify:image',
						},
						children: [
							{
								path: '/content/anti-fake/add',
								name: 'addGoodAntiFaket',
								component: () => import('/@/views/pages/content/antiFake/add.vue'),
								meta: {
									title: '新增图鉴',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'content:verify:image:create:invoke',
								},
							},
							{
								path: '/content/anti-fake/edit/:id',
								name: 'editGoodAntiFake',
								component: () => import('/@/views/pages/content/antiFake/add.vue'),
								meta: {
									title: '编辑图鉴',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'content:verify:image:edit:invoke',
								},
							},
						],
					},
					{
						path: '/content/creation',
						name: 'contentCreation',
						component: () => import('/@/views/pages/content/creation/index.vue'),
						meta: {
							title: '内容创作',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'content:creation',
						},
						children: [
							{
								path: '/content/creation/add',
								name: 'addGoodCreationt',
								component: () => import('/@/views/pages/content/creation/add.vue'),
								meta: {
									title: '新增内容',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'content:creation:create:invoke',
								},
							},
							{
								path: '/content/creation/edit/:id',
								name: 'editGoodCreation',
								component: () => import('/@/views/pages/content/creation/add.vue'),
								meta: {
									title: '编辑内容',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'content:creation:edit:invoke',
								},
							},
						],
					},
					{
						path: '/content/type',
						name: 'contentType',
						component: () => import('/@/views/pages/content/type/index.vue'),
						meta: {
							title: '内容分类',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'content:category',
						},
					},
				],
			},
			{
				path: '/activity',
				name: 'activity',
				redirect: '/activity/list',
				meta: {
					title: '活动管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'activity:management',
					icon: 'svg-activity',
				},
				children: [
					{
						path: '/activity/list',
						name: 'activityList',
						component: () => import('/@/views/pages/activity/list/index.vue'),
						meta: {
							title: '线下活动',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'activity:management:sub',
						},
						children: [
							{
								path: '/activity/list/add',
								name: 'addActivity',
								component: () => import('/@/views/pages/activity/list/add.vue'),
								meta: {
									title: '新增活动',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'activity:create:invoke',
								},
							},
							{
								path: '/activity/list/edit/:id',
								name: 'editActivity',
								component: () => import('/@/views/pages/activity/list/add.vue'),
								meta: {
									title: '编辑活动',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'activity:edit:invoke',
								},
							},
							{
								path: '/activity/list/invite/:id',
								name: 'activityInvite',
								component: () => import('/@/views/pages/activity/invite/index.vue'),
								meta: {
									title: '定向邀请',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'activity:invite:invoke',
								},
							},
							{
								path: '/activity/list/data/:id',
								name: 'activityData',
								component: () => import('/@/views/pages/activity/data/index.vue'),
								meta: {
									title: '活动数据',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'activity:data:invoke',
								},
							},
						],
					},
				],
			},
			{
				path: '/lottery',
				name: 'lottery',
				redirect: '/lottery/list',
				meta: {
					title: '抽奖管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'draw:management',
					icon: 'svg-lottery',
				},
				children: [
					{
						path: '/lottery/list',
						name: 'lotteryList',
						component: () => import('/@/views/pages/lottery/list/index.vue'),
						meta: {
							title: '抽奖活动',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'draw:activity',
						},
						children: [
							{
								path: '/lottery/list/add',
								name: 'addLottery',
								component: () => import('/@/views/pages/lottery/list/add.vue'),
								meta: {
									title: '新增活动',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'draw:activity:create:invoke',
								},
							},
							{
								path: '/lottery/list/edit/:id',
								name: 'editLottery',
								component: () => import('/@/views/pages/lottery/list/add.vue'),
								meta: {
									title: '编辑活动',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'draw:activity:edit:invoke',
								},
							},
							{
								path: '/lottery/list/data/:id',
								name: 'lotteryData',
								component: () => import('/@/views/pages/lottery/data/index.vue'),
								meta: {
									title: '抽奖数据',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'draw:activity:data:invoke',
								},
							},
						],
					},
				],
			},
			{
				path: '/user',
				name: 'user',
				redirect: '/user/list',
				meta: {
					title: '用户管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'svg-user',
					auth: 'user:management',
				},
				children: [
					{
						path: '/user/list',
						name: 'userList',
						component: () => import('/@/views/pages/user/list/index.vue'),
						meta: {
							title: '用户列表',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'user:list',
							icon: 'iconfont icon-shouye',
						},
						children: [
							{
								path: '/user/detail/:id',
								name: 'userDetail',
								component: () => import('/@/views/pages/user/list/detail.vue'),
								meta: {
									title: '用户详情',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'user:details:invoke',
								},
							},
						],
					},
					{
						path: '/user/dealer-auth',
						name: 'userDealerAuth',
						component: () => import('/@/views/pages/user/dealerAuth/index.vue'),
						meta: {
							title: '经销商认证',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'user:dealer:authentication',
						},
					},
				],
			},
			{
				path: '/data',
				name: 'data',
				redirect: '/data/list',
				meta: {
					title: '数据管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					roles: ['admin', 'common'],
					icon: 'svg-data',
					auth: 'data:management',
				},
				children: [
					{
						path: '/data/inventory',
						name: 'dataInventory',
						component: () => import('/@/views/pages/data/inventory/index.vue'),
						meta: {
							title: '年份酒库存数据',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:inventory',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/cost',
						name: 'dataCost',
						component: () => import('/@/views/pages/data/cost/index.vue'),
						meta: {
							title: '年份酒价值分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:value:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/warehouse',
						name: 'dataWarehouse',
						component: () => import('/@/views/pages/data/warehouse/index.vue'),
						meta: {
							title: '年份酒出入库数据',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:stock-in-out:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/b2cGood',
						name: 'dataB2cGood',
						component: () => import('/@/views/pages/data/b2cGood/index.vue'),
						meta: {
							title: 'B2C商品分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:b2c:product',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/user',
						name: 'dataUser',
						component: () => import('/@/views/pages/data/user/index.vue'),
						meta: {
							title: '用户分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:user:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/b2cDeal',
						name: 'dataB2cDeal',
						component: () => import('/@/views/pages/data/b2cDeal/index.vue'),
						meta: {
							title: 'B2C商城交易分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:b2c:mall:trade:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/c2cMarket',
						name: 'dataC2cMarket',
						component: () => import('/@/views/pages/data/c2cMarket/index.vue'),
						meta: {
							title: 'C2C集市分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:c2c:market:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
					{
						path: '/data/c2cCliquor',
						name: 'dataC2cCliquor',
						component: () => import('/@/views/pages/data/c2cCliquor/index.vue'),
						meta: {
							title: 'C2C酒藏分析',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'data:c2c:cert:analysis',
							icon: 'iconfont icon-shouye',
						},
					},
				],
			},
			{
				path: '/finance',
				name: 'finance',
				redirect: '/finance/invoice',
				meta: {
					title: '财务管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'finance:management',
					icon: 'svg-finance',
				},
				children: [
					{
						path: '/finance/invoice',
						name: 'financeInvoice',
						component: () => import('/@/views/pages/finance/invoice/index.vue'),
						meta: {
							title: '开票管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'finance:invoice:management',
						},
					},
					{
						path: '/finance/pay',
						name: 'financePay',
						component: () => import('/@/views/pages/finance/pay/index.vue'),
						meta: {
							title: '支付管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'finance:payment:management',
						},
						children: [
							{
								path: '/finance/pay-zft',
								name: 'financePayZft',
								component: () => import('/@/views/pages/finance/pay/zft.vue'),
								meta: {
									title: '直付通商户',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'finance:payment:zft',
								},
							},
							{
								path: '/finance/pay-sft',
								name: 'financePaySft',
								component: () => import('/@/views/pages/finance/pay/sft.vue'),
								meta: {
									title: '收付通商户',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'finance:payment:sft',
								},
							},
						],
					},
				],
			},
			{
				path: '/system',
				name: 'system',
				redirect: '/system/setting',
				meta: {
					title: '系统管理',
					isLink: '',
					isHide: false,
					isKeepAlive: false,
					isAffix: false,
					isIframe: false,
					auth: 'system:management',
					icon: 'svg-setting',
				},
				children: [
					{
						path: '/system/setting',
						name: 'systemSetting',
						component: () => import('/@/views/pages/system/setting/index.vue'),
						meta: {
							title: '系统设置',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:settings',
						},
					},
					{
						path: '/system/account',
						name: 'systemAccount',
						component: () => import('/@/views/pages/system/account/index.vue'),
						meta: {
							title: '账号管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:account:management',
						},
						children: [
							{
								path: '/system/account/add',
								name: 'addSystemAccount',
								component: () => import('/@/views/pages/system/account/add.vue'),
								meta: {
									title: '新增账号',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'system:account:create:invoke',
								},
							},
							{
								path: '/system/account/edit/:id',
								name: 'editSystemAccount',
								component: () => import('/@/views/pages/system/account/add.vue'),
								meta: {
									title: '编辑账号',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'system:account:edit:invoke',
								},
							},
						],
					},
					{
						path: '/system/role',
						name: 'systemRole',
						component: () => import('/@/views/pages/system/role/index.vue'),
						meta: {
							title: '角色权限',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:role:permission',
						},
						children: [
							{
								path: '/system/role/add',
								name: 'addSystemRole',
								component: () => import('/@/views/pages/system/role/add.vue'),
								meta: {
									title: '新增角色',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'system:role:create:invoke',
								},
							},
							{
								path: '/system/role/edit/:id',
								name: 'editSystemRole',
								component: () => import('/@/views/pages/system/role/add.vue'),
								meta: {
									title: '编辑角色',
									isLink: '',
									isHide: true,
									isKeepAlive: false,
									isAffix: false,
									isIframe: false,
									auth: 'system:role:edit:invoke',
								},
							},
						],
					},
					{
						path: '/system/notice',
						name: 'systemNotice',
						component: () => import('/@/views/pages/system/notice/index.vue'),
						meta: {
							title: '系统通知',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:notification',
						},
					},
					{
						path: '/system/agreement',
						name: 'systemAgreement',
						component: () => import('/@/views/pages/system/agreement/index.vue'),
						meta: {
							title: '服务协议',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:service:agreement',
						},
					},
					{
						path: '/system/operation',
						name: 'systemOperation',
						component: () => import('/@/views/pages/system/operation/index.vue'),
						meta: {
							title: '操作记录',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:operation:records',
						},
					},
					{
						path: '/system/worth',
						name: 'systemWorth',
						component: () => import('/@/views/pages/system/worth/index.vue'),
						meta: {
							title: '价值管理',
							isLink: '',
							isHide: false,
							isKeepAlive: false,
							isAffix: false,
							isIframe: false,
							auth: 'system:value:management',
						},
					},
				],
			},
		],
	},
];

/**
 * 定义404、401界面
 * @link 参考：https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
 */
export const notFoundAndNoPower = [
	{
		path: '/401',
		name: 'noPower',
		component: () => import('/@/views/error/401.vue'),
		meta: {
			title: '无权限',
			isHide: true,
		},
	},
	{
		path: '/:pathMatch(.*)*',
		name: 'notFound',
		component: () => import('/@/views/error/404.vue'),
		meta: {
			title: '404',
			isHide: true,
		},
	},
];

/**
 * 定义静态路由（默认路由）
 * 此路由不要动，前端添加路由的话，请在 `dynamicRoutes 数组` 中添加
 * @description 前端控制直接改 dynamicRoutes 中的路由，后端控制不需要修改，请求接口路由数据时，会覆盖 dynamicRoutes 第一个顶级 children 的内容（全屏，不包含 layout 中的路由出口）
 * @returns 返回路由菜单数据
 */
export const staticRoutes: Array<RouteRecordRaw> = [
	{
		path: '/login',
		name: 'login',
		component: () => import('/@/views/login/index.vue'),
		meta: {
			title: '登录',
		},
	},
];
